package com.junlaninfo;

import java.util.*;

/**
 * Created by 辉 on 2020/12/7.
 */
public class Test3 {
    public static void main(String[] args) {
        List<String> beforeList = new ArrayList<String>();
        beforeList.add("sun");
        beforeList.add("star");
        beforeList.add("moon");
        beforeList.add("earth");
        beforeList.add("sun");
        beforeList.add("earth");
        Set<String> middleLinkedHashSet = new LinkedHashSet<String>(beforeList);
        List<String> afterHashSetList = new ArrayList<String>(middleLinkedHashSet);
        System.out.println(beforeList);
        System.out.println(afterHashSetList);
    }
}
